home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL / glmap1.z / glmap1
Encoding:
Text File  |  2002-10-03  |  18.3 KB  |  281 lines

  1.  
  2.  
  3.  
  4. ggggllllMMMMaaaapppp1111((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp1111((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllMMMMaaaapppp1111dddd,,,, ggggllllMMMMaaaapppp1111ffff - define a one-dimensional evaluator
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      void ggggllllMMMMaaaapppp1111dddd( GLenum _t_a_r_g_e_t,
  14.                    GLdouble _u_1,
  15.                    GLdouble _u_2,
  16.                    GLint _s_t_r_i_d_e,
  17.                    GLint _o_r_d_e_r,
  18.                    const GLdouble *_p_o_i_n_t_s )
  19.      void ggggllllMMMMaaaapppp1111ffff( GLenum _t_a_r_g_e_t,
  20.                    GLfloat _u_1,
  21.                    GLfloat _u_2,
  22.                    GLint _s_t_r_i_d_e,
  23.                    GLint _o_r_d_e_r,
  24.                    const GLfloat *_p_o_i_n_t_s )
  25.  
  26.  
  27. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  28.      _t_a_r_g_e_t  Specifies the kind of values that are generated by the evaluator.
  29.              Symbolic constants GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333, GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444,
  30.              GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX, GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444, GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL,
  31.              GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111, GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222,
  32.              GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333, and GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444 are
  33.              accepted.
  34.  
  35.      _u_1, _u_2  Specify a linear mapping of u, as presented to ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111, to
  36.              u^, the variable that is evaluated by the equations specified by
  37.              this command.
  38.  
  39.      _s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  40.              of one control point and the beginning of the next one in the
  41.              data structure referenced in _p_o_i_n_t_s.  This allows control points
  42.              to be embedded in arbitrary data structures.  The only constraint
  43.              is that the values for a particular control point must occupy
  44.              contiguous memory locations.
  45.  
  46.      _o_r_d_e_r   Specifies the number of control points.  Must be positive.
  47.  
  48.      _p_o_i_n_t_s  Specifies a pointer to the array of control points.
  49.  
  50.  
  51. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  52.      Evaluators provide a way to use polynomial or rational polynomial mapping
  53.      to produce vertices, normals, texture coordinates, and colors.  The
  54.      values produced by an evaluator are sent to further stages of GL
  55.      processing just as if they had been presented using ggggllllVVVVeeeerrrrtttteeeexxxx, ggggllllNNNNoooorrrrmmmmaaaallll,
  56.      ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, and ggggllllCCCCoooolllloooorrrr commands, except that the generated values do not
  57.      update the current normal, texture coordinates, or color.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggllllMMMMaaaapppp1111((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp1111((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      All polynomial or rational polynomial splines of any degree (up to the
  75.      maximum degree supported by the GL implementation) can be described using
  76.      evaluators.  These include almost all splines used in computer graphics:
  77.      B-splines, Bezier curves, Hermite splines, and so on.
  78.  
  79.      Evaluators define curves based on Bernstein polynomials.  Define p(u^) as
  80.  
  81.                                              n
  82.  
  83.                                             R   n
  84.                                 p(u^)  =       B (u^)R
  85.                                          i=0   i    i
  86.  
  87.                                        n
  88.      where R  is a control point and B (u^) is the ith Bernstein polynomial of
  89.             i                         i
  90.      degree n (_o_r_d_e_r = n + 1):
  91.  
  92.                                        (    )
  93.                                n          n    i     n-i
  94.                              B (u^)  =  |    | u^ (1-u^)
  95.                               i
  96.                                        (i  )
  97.  
  98.  
  99.      Recall that
  100.  
  101.                                          (     )
  102.                                0            n
  103.                               0  _= 1 and |     |   _=  1
  104.  
  105.                                          ( 0  )
  106.  
  107.  
  108.      ggggllllMMMMaaaapppp1111 is used to define the basis and to specify what kind of values are
  109.      produced.  Once defined, a map can be enabled and disabled by calling
  110.      ggggllllEEEEnnnnaaaabbbblllleeee and ggggllllDDDDiiiissssaaaabbbblllleeee with the map name, one of the nine predefined
  111.      values for _t_a_r_g_e_t described below.  ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111 evaluates the one-
  112.      dimensional maps that are enabled.  When ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111 presents a value u,
  113.      the Bernstein functions are evaluated using u^, where
  114.  
  115.                                                 u - u1_______
  116.                                    u^  =
  117.                                          u2 - u1
  118.  
  119.  
  120.  
  121.      _t_a_r_g_e_t is a symbolic constant that indicates what kind of control points
  122.      are provided in _p_o_i_n_t_s, and what output is generated when the map is
  123.      evaluated.  It can assume one of nine predefined values:
  124.  
  125.      GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333         Each control point is three floating-point
  126.                               values representing x, y, and z.  Internal
  127.                               ggggllllVVVVeeeerrrrtttteeeexxxx3333 commands are generated when the map is
  128.                               evaluated.
  129.  
  130.      GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444         Each control point is four floating-point values
  131.                               representing x, y, z, and w.  Internal ggggllllVVVVeeeerrrrtttteeeexxxx4444
  132.                               commands are generated when the map is
  133.                               evaluated.
  134.  
  135.      GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX            Each control point is a single floating-point
  136.                               value representing a color index.  Internal
  137.                               ggggllllIIIInnnnddddeeeexxxx commands are generated when the map is
  138.                               evaluated but the current index is not updated
  139.                               with the value of these ggggllllIIIInnnnddddeeeexxxx commands.
  140.  
  141.  
  142.  
  143.  
  144.  
  145.                                                                         PPPPaaaaggggeeee 2222
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. ggggllllMMMMaaaapppp1111((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp1111((((3333GGGG))))
  153.  
  154.  
  155.  
  156.      GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444          Each control point is four floating-point values
  157.                               representing red, green, blue, and alpha.
  158.                               Internal ggggllllCCCCoooolllloooorrrr4444 commands are generated when
  159.                               the map is evaluated but the current color is
  160.                               not updated with the value of these ggggllllCCCCoooolllloooorrrr4444
  161.                               commands.
  162.  
  163.      GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL           Each control point is three floating-point
  164.                               values representing the x, y, and z components
  165.                               of a normal vector.  Internal ggggllllNNNNoooorrrrmmmmaaaallll commands
  166.                               are generated when the map is evaluated but the
  167.                               current normal is not updated with the value of
  168.                               these ggggllllNNNNoooorrrrmmmmaaaallll commands.
  169.  
  170.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111  Each control point is a single floating-point
  171.                               value representing the s texture coordinate.
  172.                               Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd1111 commands are generated when
  173.                               the map is evaluated but the current texture
  174.                               coordinates are not updated with the value of
  175.                               these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  176.  
  177.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222  Each control point is two floating-point values
  178.                               representing the s and t texture coordinates.
  179.                               Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd2222 commands are generated when
  180.                               the map is evaluated but the current texture
  181.                               coordinates are not updated with the value of
  182.                               these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  183.  
  184.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333  Each control point is three floating-point
  185.                               values representing the s, t, and r texture
  186.                               coordinates.  Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd3333 commands are
  187.                               generated when the map is evaluated but the
  188.                               current texture coordinates are not updated with
  189.                               the value of these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  190.  
  191.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444  Each control point is four floating-point values
  192.                               representing the s, t, r, and q texture
  193.                               coordinates.  Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd4444 commands are
  194.                               generated when the map is evaluated but the
  195.                               current texture coordinates are not updated with
  196.                               the value of these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  197.  
  198.      _s_t_r_i_d_e, _o_r_d_e_r, and _p_o_i_n_t_s define the array addressing for accessing the
  199.      control points.  _p_o_i_n_t_s is the location of the first control point, which
  200.      occupies one, two, three, or four contiguous memory locations, depending
  201.      on which map is being defined.  _o_r_d_e_r is the number of control points in
  202.      the array.  _s_t_r_i_d_e specifies how many float or double locations to
  203.      advance the internal memory pointer to reach the next control point.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                                                                         PPPPaaaaggggeeee 3333
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218. ggggllllMMMMaaaapppp1111((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp1111((((3333GGGG))))
  219.  
  220.  
  221.  
  222. NOTES
  223.      As is the case with all GL commands that accept pointers to data, it is
  224.      as if the contents of _p_o_i_n_t_s were copied by ggggllllMMMMaaaapppp1111 before ggggllllMMMMaaaapppp1111 returns.
  225.      Changes to the contents of _p_o_i_n_t_s have no effect after ggggllllMMMMaaaapppp1111 is called.
  226.  
  227. EEEERRRRRRRROOOORRRRSSSS
  228.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _t_a_r_g_e_t is not an accepted value.
  229.  
  230.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _u_1 is equal to _u_2.
  231.  
  232.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _s_t_r_i_d_e is less than the number of values
  233.      in a control point.
  234.  
  235.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _o_r_d_e_r is less than 1 or greater than the
  236.      return value of GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR.
  237.  
  238.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllMMMMaaaapppp1111 is executed between the
  239.      execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.
  240.  
  241. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  242.      ggggllllGGGGeeeettttMMMMaaaapppp
  243.      ggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR
  244.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333
  245.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444
  246.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX
  247.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444
  248.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL
  249.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111
  250.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222
  251.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333
  252.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444
  253.  
  254.  
  255. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  256.      ggggllllBBBBeeeeggggiiiinnnn, ggggllllCCCCoooolllloooorrrr, ggggllllEEEEnnnnaaaabbbblllleeee, ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd, ggggllllEEEEvvvvaaaallllMMMMeeeesssshhhh, ggggllllEEEEvvvvaaaallllPPPPooooiiiinnnntttt, ggggllllMMMMaaaapppp2222,
  257.      ggggllllMMMMaaaappppGGGGrrrriiiidddd, ggggllllNNNNoooorrrrmmmmaaaallll, ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, ggggllllVVVVeeeerrrrtttteeeexxxx
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.                                                                         PPPPaaaaggggeeee 4444
  278.  
  279.  
  280.  
  281.